/**
 * 切换元素的全屏显示状态
 *
 * @param {Element} element - 目标元素实例
 * @description 如果当前已经处于全屏模式则退出，否则将指定元素切换为全屏显示
 */
export function fullScreen(element) {
  if (document.fullscreenElement) {
    document.exitFullscreen()
  } else if (element.requestFullscreen) {
    element.requestFullscreen()
  } else if (element.mozRequestFullScreen) {
    // Firefox
    element.mozRequestFullScreen()
  } else if (element.webkitRequestFullscreen) {
    // Chrome, Safari, Opera
    element.webkitRequestFullscreen()
  } else if (element.msRequestFullscreen) {
    // IE/Edge
    element.msRequestFullscreen()
  }
}
